package work.comeback.omo.service.crawler;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;


public class JsoupExample {
    public static void main(String[] args) throws Exception {
        // 通过 Jsoup 获取 HTML 页面
        Document doc = Jsoup.connect("https://example.com").get();

        // 提取网页标题
        String title = doc.title();
        System.out.println("Title: " + title);

        // 提取所有链接
        Elements links = doc.select("a[href]");
        for (Element link : links) {
            System.out.println("Link: " + link.attr("href"));
        }
    }
}
